How to add between different types - rust

description
No value
aliases
No value
tags
No value
created
2023-04-04T15:03:38
updated
2023-07-15T21:33:04
title
How to add between different types - rust
impl std::ops::Add<B> for A {
    type Output = B;
    fn add(self, rhs: B) -> Self::Output { todo!() }
}
impl std::ops::Add<A> for B {
    type Output = B;
    fn add(self, rhs: A) -> Self::Output { todo!() }
}